package com.atguigu.practice;

import java.util.Arrays;
import java.util.Scanner;

public class MaxLevel {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] array=new int[n*3];
        for(int i=0;i<array.length;i++){
            array[i]=scanner.nextInt();
        }
        Arrays.sort(array);
        int max=0;
        int tmp=array.length-2;
        for(int i=0;i<n;i++){
            max+=array[tmp];
            tmp-=2;
        }
        System.out.println(max);
    }
}
